package DataValidatorSchema::Bla;
use strict;
use base qw/ DBIx::Class /;

__PACKAGE__->load_components( qw/ Component::DataValidator Core / );
__PACKAGE__->table( 'bla' );
__PACKAGE__->resultset_class( qw/ DataValidatorSchema::FooResultSet / );


__PACKAGE__->add_columns(
    id => {
        validation => {
            required => 1,
            constraint => qr~^\d+$~
        }
    },
    name => {
        validation => {
            required => 1,
            constraint => sub {
                my ( $dv, $v ) = @_;
                return $v eq 'bla' || $v =~ /^123/;
            }
        }
    }
);
__PACKAGE__->set_primary_key( qw/ id / );



1;
